package com.kaifamiao.demo.d0809;

public class LinkedList {

    private Node first;

    public void add(String value){
        if (first == null){
            first = new Node();
            first.value = value;
        } else {
            Node current = first;
            while(current.next != null){
                current = current.next;
            }

            current.next = new Node();
            current.next.value = value;
        }
    }


    private class Node{
        String value;

        Node next;
    }
}
